﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessObjects.BO_GetObjects;

public partial class Controls_TopMenu : Admin_Controls_Base
{
    //protected void Page_Load(object sender, EventArgs e)
    //{
    //    if(!IsPostBack)
    //    {
            
    //    }
    //    Display();
    //}
    //protected void Display()
    //{
        
    //    bindRepeater(rptMenu,BO_portal_categories.GetMenu(0));
    //}

    protected void Page_Load(object sender, EventArgs e) {
        if(!IsPostBack) {
            LoadData();
        }
    }
    //LOad data
    public void LoadData() {
        base.bindRepeater(rptData, BO_portal_categories.GetMenu(0));
    }
    protected string getActive(string category_id, int index)
    {
        if (string.IsNullOrEmpty(Request["CATEGORY_ID"]))
        {
            if (index == 0)
            {
                return "active";
            }
        }
        if (Request["category_id"] == category_id)
        {
            return "active";
        }
        return "";
    }

    protected string getLink(string eng, string viet, string id)
    {
        if (!string.IsNullOrEmpty(eng))
        {
            return eng;
        }
        else
            return "/c" + id + "/" + DigiLib.StringUtils.RemoveUnicode(viet, "-") + ".html";
    }


}